package com.ffcs.web.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 * @description: 获取spring bean封装类
 * @Company: 北京福富软件有限公司 
 * @author 吴鼎良 Nov 18, 2011
 * @version 1.00.00
 * @Copyright: Copyright (c) 2008 FFCS All Rights Reserved 
 */

public class SpringUtils {
	private static ApplicationContext context;

	static {   
        try {   
            context = new ClassPathXmlApplicationContext(   
                    "classpath:applicationContext.xml");   
        } catch (RuntimeException e) {   
            e.printStackTrace();   
        }   
    }   
	
	public static Object getBean(String beanName) {   
        return context.getBean(beanName);   
    } 
}
